x,y = input().split()
time1 = x.split(':')
time2 = y.split(':')
try:
    time1 = [int(i) for i in time1]
    time2 = [int(i) for i in time2]
except:
    print("Illegal Time")
    exit()
else:
    if not 0 <= time1[0] < 24 or not 0 <= time2[0] < 24 or \
            not 0 <= time1[1] < 60 or not 0 <= time2[1] < 60:
        print("Illegal Time")
        exit()
    hour = 0
    minute = 0
    if time1[0] < time2[0]:
        total = (time2[0] - time1[0]) * 60 + time2[1] - time1[1]
        hour = total // 60
        minute = total % 60
    else:
        total = (time2[0] + 24 - time1[0]) * 60 + time2[1] - time1[1]
        hour = total // 60
        minute = total % 60
    print(f"{hour}:{minute}")